import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    component: () => import('@/layout/MainLayout.vue'),
    redirect: '/devices',
    children: [
      {
        path: '/devices',
        name: 'Devices',
        component: () => import('@/views/devices/DeviceList.vue'),
        meta: { title: '设备列表' }
      },
      {
        path: '/devices/:id',
        name: 'DeviceDetail',
        component: () => import('@/views/devices/DeviceDetail.vue'),
        meta: { title: '设备详情' }
      },
      {
        path: '/wards',
        name: 'Wards',
        component: () => import('@/views/wards/WardManagement.vue'),
        meta: { title: '病房管理' }
      },
      {
        path: '/statistics',
        name: 'Statistics',
        component: () => import('@/views/statistics/UsageStatistics.vue'),
        meta: { title: '使用统计' }
      },
      {
        path: '/config',
        name: 'Config',
        component: () => import('@/views/config/SystemConfig.vue'),
        meta: { title: '系统配置' }
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router

